package com.aspose.cells;

public class ShadowEffect {
   private ShapePropertyCollection a;

   ShadowEffect(ShapePropertyCollection spPr) {
      this.a = spPr;
   }

   public int getPresetType() {
      return this.a();
   }

   public void setPresetType(int value) {
      this.a(value);
      this.a.h();
   }

   private int a() {
      zsb var1 = this.a.f();
      if (var1 == null) {
         return 0;
      } else {
         zasi var2 = var1.j();
         zakj var3 = var1.h();
         if (var2 == null && var3 == null) {
            return 0;
         } else {
            if (var2 != null) {
               if (this.a(var2, 50800, 38100, 2700000, 100000, 100000, 0, 0, 7, 40000)) {
                  return 2;
               }

               if (this.a(var2, 50800, 38100, 5400000, 100000, 100000, 0, 0, 6, 40000)) {
                  return 3;
               }

               if (this.a(var2, 50800, 38100, 8100000, 100000, 100000, 0, 0, 8, 40000)) {
                  return 4;
               }

               if (this.a(var2, 50800, 38100, 0, 100000, 100000, 0, 0, 4, 40000)) {
                  return 5;
               }

               if (this.a(var2, 63500, 0, 0, 102000, 102000, 0, 0, 3, 40000)) {
                  return 6;
               }

               if (this.a(var2, 50800, 38100, 10800000, 100000, 100000, 0, 0, 5, 40000)) {
                  return 7;
               }

               if (this.a(var2, 50800, 38100, 18900000, 100000, 100000, 0, 0, 1, 40000)) {
                  return 8;
               }

               if (this.a(var2, 50800, 38100, 16200000, 100000, 100000, 0, 0, 0, 40000)) {
                  return 9;
               }

               if (this.a(var2, 50800, 38100, 13500000, 100000, 100000, 0, 0, 2, 40000)) {
                  return 10;
               }

               if (this.a(var2, 76200, 0, 13500000, 100000, 23000, 1200000, 0, 2, 20000)) {
                  return 20;
               }

               if (this.a(var2, 76200, 0, 18900000, 100000, 23000, -1200000, 0, 1, 20000)) {
                  return 21;
               }

               if (this.a(var2, 152400, 317500, 5400000, 90000, -19000, 0, 0, 0, 15000)) {
                  return 22;
               }

               if (this.a(var2, 76200, 12700, 8100000, 100000, -23000, 800400, 0, 2, 20000)) {
                  return 23;
               }

               if (this.a(var2, 76200, 12700, 2700000, 100000, -23000, -800400, 0, 1, 20000)) {
                  return 24;
               }
            }

            if (var3 != null) {
               if (this.a(var3, 63500, 50800, 13500000)) {
                  return 11;
               }

               if (this.a(var3, 63500, 50800, 16200000)) {
                  return 12;
               }

               if (this.a(var3, 63500, 50800, 18900000)) {
                  return 13;
               }

               if (this.a(var3, 63500, 50800, 10800000)) {
                  return 14;
               }

               if (this.a(var3, 114300, 0, 0)) {
                  return 15;
               }

               if (this.a(var3, 63500, 50800, 0)) {
                  return 16;
               }

               if (this.a(var3, 63500, 50800, 8100000)) {
                  return 17;
               }

               if (this.a(var3, 63500, 50800, 5400000)) {
                  return 18;
               }

               if (this.a(var3, 63500, 50800, 2700000)) {
                  return 19;
               }
            }

            return 1;
         }
      }
   }

   private void a(int var1) {
      if (var1 == 0) {
         this.a.clearShadowEffect();
      } else if (var1 != 1) {
         switch(var1) {
         case 2:
            this.a(50800, 38100, 2700000, 100000, 100000, 0, 0, 7, 40000);
            break;
         case 3:
            this.a(50800, 38100, 5400000, 100000, 100000, 0, 0, 6, 40000);
            break;
         case 4:
            this.a(50800, 38100, 8100000, 100000, 100000, 0, 0, 8, 40000);
            break;
         case 5:
            this.a(50800, 38100, 0, 100000, 100000, 0, 0, 4, 40000);
            break;
         case 6:
            this.a(63500, 0, 0, 102000, 102000, 0, 0, 3, 40000);
            break;
         case 7:
            this.a(50800, 38100, 10800000, 100000, 100000, 0, 0, 5, 40000);
            break;
         case 8:
            this.a(50800, 38100, 18900000, 100000, 100000, 0, 0, 1, 40000);
            break;
         case 9:
            this.a(50800, 38100, 16200000, 100000, 100000, 0, 0, 0, 40000);
            break;
         case 10:
            this.a(50800, 38100, 13500000, 100000, 100000, 0, 0, 2, 40000);
            break;
         case 11:
            this.a(63500, 50800, 13500000);
            break;
         case 12:
            this.a(63500, 50800, 16200000);
            break;
         case 13:
            this.a(63500, 50800, 18900000);
            break;
         case 14:
            this.a(63500, 50800, 10800000);
            break;
         case 15:
            this.a(114300, 0, 0, -1);
            break;
         case 16:
            this.a(63500, 50800, 0);
            break;
         case 17:
            this.a(63500, 50800, 8100000);
            break;
         case 18:
            this.a(63500, 50800, 5400000);
            break;
         case 19:
            this.a(63500, 50800, 2700000);
            break;
         case 20:
            this.a(76200, 0, 13500000, 100000, 23000, 1200000, 0, 2, 20000);
            break;
         case 21:
            this.a(76200, 0, 18900000, 100000, 23000, -1200000, 0, 1, 20000);
            break;
         case 22:
            this.a(152400, 317500, 5400000, 90000, -19000, 0, 0, 0, 15000);
            break;
         case 23:
            this.a(76200, 12700, 8100000, 100000, -23000, 800400, 0, 2, 20000);
            break;
         case 24:
            this.a(76200, 12700, 2700000, 100000, -23000, -800400, 0, 1, 20000);
         }

      }
   }

   private void a(int var1, int var2, int var3) {
      this.a(var1, var2, var3, 50000);
   }

   private void a(int var1, int var2, int var3, int var4) {
      zsb var5 = this.a.g();
      var5.f();
      zakj var6 = var5.g();
      var6.b = var1;
      var6.d = var2;
      var6.c = var3;
      CellsColor var7 = new CellsColor(this.a.a());
      var7.setColor(Color.getBlack());
      if (var4 != -1) {
         var7.a(var4 / 1000);
      }

      var6.a(var7);
   }

   private void a(int var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9) {
      zsb var10 = this.a.g();
      var10.f();
      zasi var11 = var10.i();
      var11.b = var1;
      var11.e = var2;
      var11.d = var3;
      var11.d(var4);
      var11.e(var5);
      var11.b(var6);
      var11.c(var7);
      var11.a(var8);
      var11.h = false;
      CellsColor var12 = new CellsColor(this.a.a());
      var12.setColor(Color.getBlack());
      if (var9 != -1) {
         var12.a(var9 / 1000);
      }

      var11.a(var12);
   }

   private boolean a(zasi var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, int var10) {
      if (var1.b == var2 && var1.e == var3 && var1.d == var4 && var1.j() == var5 && var1.k() == var6 && var1.g() == var7 && var1.h() == var8 && var1.d() == var9 && !var1.i()) {
         zakp var11 = var1.a;
         return var11 != null && var11.b() == 2 && var11.d() == 0 && var11.h() == var10;
      } else {
         return false;
      }
   }

   private boolean a(zakj var1, int var2, int var3, int var4) {
      if (var1.b == var2 && var1.d == var3 && var1.c == var4) {
         zakp var5 = var1.a;
         return var5 != null && var5.b() == 2 && var5.d() == 0 && var5.h() != 50000;
      } else {
         return false;
      }
   }

   public CellsColor getColor() {
      zsb var1 = this.a.g();
      zasi var2 = var1.j();
      zakj var3 = var1.h();
      if (var2 != null) {
         return var2.b();
      } else if (var3 != null) {
         return var3.b();
      } else {
         this.a(50800, 50800, 5400000, 100000, 100000, 0, 0, 3, -1);
         var2 = var1.j();
         return var2.b();
      }
   }

   public void setColor(CellsColor value) {
      if (value != null) {
         zsb var2 = this.a.g();
         zasi var3 = var2.j();
         zakj var4 = var2.h();
         if (var3 != null) {
            var3.a(value);
         } else if (var4 != null) {
            var4.a(value);
         } else {
            this.a(50800, 50800, 5400000, 100000, 100000, 0, 0, 3, -1);
            var3 = var2.j();
            var3.a(value);
         }

      }
   }

   private void b() {
      zsb var1 = this.a.g();
      zasi var2 = var1.j();
      zakj var3 = var1.h();
      if (var2 == null && var3 == null) {
         this.a(50800, 50800, 5400000, 100000, 100000, 0, 0, 3, 43);
      }

      this.a.h();
   }

   public double getTransparency() {
      zakp var1 = null;
      this.b();
      if (this.a.g().h() != null) {
         var1 = this.a.g().h().a;
      } else {
         var1 = this.a.g().j().a;
      }

      return var1 == null ? 0.0D : (new CellsColor((Workbook)null, var1)).getTransparency();
   }

   public void setTransparency(double value) {
      if (value >= 0.0D && value <= 1.0D) {
         this.b();
         this.getColor().setTransparency(value);
      } else {
         throw new CellsException(6, "Transparency must between 0.0 (opaque) and 1.0 (clear)");
      }
   }

   public double getSize() {
      zasi var1 = this.a.g().j();
      if (var1 != null) {
         return var1.j() == var1.k() ? (double)var1.j() / 100000.0D : 1.0D;
      } else {
         return 0.0D;
      }
   }

   public void setSize(double value) {
      if (value >= 0.0D && value <= 2.0D) {
         this.b();
         zasi var3 = this.a.g().j();
         if (var3 != null) {
            var3.d((int)(value * 100000.0D));
            var3.e((int)(value * 100000.0D));
         }

      } else {
         throw new CellsException(6, "Size must between 0.0 and 2.0");
      }
   }

   public double getBlur() {
      zasi var1 = this.a.g().j();
      if (var1 != null) {
         return var1.c();
      } else {
         zakj var2 = this.a.g().h();
         return var2 != null ? var2.c() : 0.0D;
      }
   }

   public void setBlur(double value) {
      if (value >= 0.0D && value <= 100.0D) {
         this.b();
         zasi var3 = this.a.g().j();
         if (var3 != null) {
            var3.a(value);
         }

         zakj var4 = this.a.g().h();
         if (var4 != null) {
            var4.a(value);
         }

      } else {
         throw new CellsException(6, "Blur must between 0 and 100 points");
      }
   }

   public double getAngle() {
      zasi var1 = this.a.g().j();
      if (var1 != null) {
         return var1.e();
      } else {
         zakj var2 = this.a.g().h();
         return var2 != null ? var2.d() : 0.0D;
      }
   }

   public void setAngle(double value) {
      if (value >= 0.0D && value <= 359.9D) {
         this.b();
         zasi var3 = this.a.g().j();
         if (var3 != null) {
            var3.b(value);
         }

         zakj var4 = this.a.g().h();
         if (var4 != null) {
            var4.b(value);
         }

      } else {
         throw new CellsException(6, "Angle must between 0 and 359.9 degrees");
      }
   }

   public double getDistance() {
      zasi var1 = this.a.g().j();
      if (var1 != null) {
         return var1.f();
      } else {
         zakj var2 = this.a.g().h();
         return var2 != null ? var2.e() : 0.0D;
      }
   }

   public void setDistance(double value) {
      if (value >= 0.0D && value <= 200.0D) {
         this.b();
         zasi var3 = this.a.g().j();
         if (var3 != null) {
            var3.c(value);
         }

         zakj var4 = this.a.g().h();
         if (var4 != null) {
            var4.c(value);
         }

      } else {
         throw new CellsException(6, "Distance must between 0 and 200 points");
      }
   }
}
